package com.ht.system.api;

import com.ht.common.core.constant.SecurityConstants;
import com.ht.common.core.constant.ServiceNameConstants;
import com.ht.common.core.domain.R;
import com.ht.system.api.dto.BaseFieldInfoDto;
import com.ht.system.api.factory.RemoteBaseFieldInfoFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

/**
 * 远程调用获取场站信息
 *
 * @author zmx
 */
@FeignClient(contextId = "remoteBaseFieldInfoService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteBaseFieldInfoFallbackFactory.class)
public interface RemoteBaseFieldInfoService {

    /**
     * 获取详情
     *
     * @param fieldCode
     * @param source
     * @return
     */
    @GetMapping("baseFieldInfo/findByFieldCode/{fieldCode}")
    R<BaseFieldInfoDto> findByFieldCode(@PathVariable("fieldCode") String fieldCode, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);


    /**
     * 获取场所列表
     *
     * @param customsCode
     * @param source
     * @return
     */
    @GetMapping("baseFieldInfo/findListByCustomsCode/{customsCode}")
    R<List<BaseFieldInfoDto>> findListByCustomsCode(@PathVariable("customsCode") String customsCode, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 获取场所列表
     *
     * @param source
     * @return
     */
    @GetMapping("baseFieldInfo/findAllFieldInfo")
    R<List<BaseFieldInfoDto>> findAllFieldInfo(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
